<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<base href="${base}/manager/" />
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
</head>
<script src="js/jquery-3.5.0.js"></script>
<script src="layer/layer.js"></script>
<script>
	$(function(){
		$("#btnsubmit").click(function(){
			let updata = {
				"opr":"upavarta",
				"sdata":$("sourceimg").val()
			}
			console.log("fdffdf");
			$.ajax({
				url:"Adminservlet",
				dataType:"json",
				type:"post",
				data:updata,
				success:function(result){
					if(result.code==200){
						$("#showimg").attr("src",result.data)
					}
				}
			})
		})
	})
</script>
<body>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>上传头像</strong>
		</div>
		
		<div class="body-content">
			<form method="post" class="form-x" action="">
				<div class="form-group">
					<div class="label">
						<label>头像上传：</label>
					</div>
					<div class="field">
						<input type="file" class="input w50" name="image" id="sourceimg"/>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>头像显示：</label>
					</div>
					<div class="field">
						<img src="" alt=""
						style="width: 100px; height: 120px" id="showimg">
						<div class="tips"></div>
					</div>
				</div>
				
				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" id="btnsubmit" type="button">
							提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
</html>